home *** CD-ROM | disk | FTP | other *** search
- #include <Aliases.h>
-
- #include "ExternalInterface.h"
-
- pascal void main(ExternalCallbackBlock *callbacks, WindowPtr w)
- {
- Handle text, file;
- StandardFileReply reply;
-
- Boolean scratch;
- short i;
-
- Boolean dispose;
-
- short count;
- StandardFileReply **files;
-
- if (callbacks->OpenSeveral(FALSE, &count, &files)) {
-
- text = callbacks->Allocate(0, FALSE);
-
- for (i = 0; i < count; i++) {
- reply = (*files)[i];
-
- if (reply.sfFlags & 0x8000)
- ResolveAliasFile(&reply.sfFile, TRUE, &scratch, &scratch);
-
- file = callbacks->GetFileText(reply.sfFile.vRefNum, reply.sfFile.parID, reply.sfFile.name,
- &dispose);
-
- if (file) {
- HandAndHand(file, text);
- if (dispose)
- DisposHandle(file);
- };
- };
-
- if (count)
- {
- w = callbacks->NewDocument();
- callbacks->SetWindowContents(w, text);
- }
- }
- }
-